/**
 * 
 */
package com.scpii.universal.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.scpii.universal.constant.GenericConstants;
import com.scpii.universal.hibernate.dao.CommentDao;
import com.scpii.universal.hibernate.dao.ContentImgDao;
import com.scpii.universal.hibernate.entity.CommentTab;
import com.scpii.universal.service.CommentService;

/**
 * genericWeb
 * 
 * @author weny 2012-7-8下午09:38:08
 */
@Service
public class CommentServiceImpl extends BaseServiceImpl<CommentTab, Integer>
		implements CommentService {
	@Resource
	private CommentDao commentDao;

	@Resource
	public void setBaseDao(CommentDao commentDao) {
		super.setBaseDao(commentDao);
	}

	@Override
	public List<CommentTab> getCommentListById(Integer intContentId) {
		StringBuffer hql = new StringBuffer("from CommentTab t");
		hql.append(" where t1.intContentId= t3.intContentId ");
		hql.append(" and t1.intDeleteSign=:intDeleteSign");

		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("intContentId", intContentId);
		argsMap.put("intDeleteSign", GenericConstants.DELETE_SIGN_EXIST);
		return commentDao.hqlGetList(hql.toString(), argsMap);
	}
}
